/* -----------------------------------------------------------------------
   See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
   ----------------------------------------------------------------------- */

////#include "ramp_filter.h"
//#include <math.h>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include "plm_config.h"
//#include "fdk.h"
//#include "fdk_opts_ext.h"
//#include "volume.h"
////#include "C:\\AAAfiles\\Anthony\\ImageView\\ImageView\\imageview.h"
//#include "readmha_ext.h"
//#include "fftw3.h"
//#include "fdk_utils_ext.h"
//#include "MGHMtx_opts.h"
//#include "write_matrix.h"
//#define FLOOD_SCALE 100
//#define isnan(x) ((x) != (x))
//
//#define MARGIN5 5
//#define HalfCenter 65
#define LINELEN 200000

//#include "fftw3.h"

//#pragma comment (lib, "C:\AAAfiles\Anthony\FFTW\libfftw3-3.lib")

//extern "C"
//{


int  read_ProjAngle(char *ProjAngle_file, float *ProjAngle)
{

	FILE *fp;
	char linebuf[LINELEN];
	int nProj=0;
	fp = fopen (ProjAngle_file,"rb");
	if (!fp) {
		fprintf (stderr, "File %s not found\n", ProjAngle_file);
		return 0;
	}
	while (fgets(linebuf,LINELEN,fp)) {
		sscanf (linebuf, "%f",&ProjAngle[nProj++]);
	}
	fclose(fp);
	return(nProj);
}



//Proj_image * my_create_Proj_image(MGHMtx_Options* Mtx_options, float angle)
//{
//	Proj_image * cbi=(Proj_image *)malloc(sizeof(Proj_image));
//	cbi->dim[0]=384;
//	cbi->dim[1]=512-HalfCenter;
//	cbi->angle=angle;
//
//
//	cbi->img = (float*) calloc ( cbi->dim[0] * cbi->dim[1],sizeof(float));
//	if (!cbi->img){
//		printf("Error in calloc cbi");
//		exit(1);
//	}
//	//printf("%f\n", angle);
//	//printf ("%18.8e %18.8e %18.8e %18.8e\n" 
//	//		"%18.8e %18.8e %18.8e %18.8e\n" 
//	//		"%18.8e %18.8e %18.8e %18.8e\n", 
//	//		cbi->matrix[0], cbi->matrix[1], cbi->matrix[2], cbi->matrix[3],
//	//		cbi->matrix[4], cbi->matrix[5], cbi->matrix[6], cbi->matrix[7],
//	//		cbi->matrix[8], cbi->matrix[9], cbi->matrix[10], cbi->matrix[11]
//	//	);
//
//	return cbi;
//
//}

//CB_Set * my_create_cb_set (MGHCBCT_Options_ext *options, MGHMtx_Options* Mtx_options,float * angles)
//{
//
//	int i,iproj;
//
//	CB_Set * cbs=(CB_Set *)malloc(sizeof(CB_Set));
//
//	cbs->nproj=(options->last_img-options->first_img)/options->skip_img+1;
//
//
//	iproj=0;
//	for (i=options->first_img; i<=options->last_img; i+=options->skip_img){
//		cbs->cbi[iproj]=my_create_Proj_image(Mtx_options, angles[i]);
//		iproj++;
//	}
//
//	return cbs;
//
//}
//
//
//CB_Set * my_create_cb_set_stream (MGHCBCT_Options_ext *options, MGHMtx_Options* Mtx_options,float * angles, int prj, int ninterval, int * intervals)
//{
//
//	int i,iproj, kint;
//	
//	CB_Set * cbs=(CB_Set *)malloc(sizeof(CB_Set));
//
//	for (kint=0; kint<ninterval; kint++){
//
//	cbs->cbi[kint]=my_create_Proj_image(Mtx_options, angles[prj+intervals[kint]]);
//
//	}
//	cbs->nproj=ninterval;
//
//	return cbs;
//
//}

			